{"ast":null,"code":"import _objectSpread from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _regeneratorRuntime from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _classCallCheck from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";import _createClass from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/createClass.js\";import{makeAutoObservable}from\"mobx\";import{UserService,AuthService,ChatService}from\"../services/\";import axios from\"axios\";import{refreshToken}from\"../routes\";import ContentService from\"../services/ContentService\";import ContactService from\"../services/ContactService\";import MessageService from\"../services/MessageService\";var Store=/*#__PURE__*/function(){function Store(){var _this=this;_classCallCheck(this,Store);this.isAuth=false;this.profile={};this.chats={};this.currentDialog={};this.viewedDialogId=null;this.contacts={};this.viewedUserProfile={};this.viewedUserProfileId=null;this.uploadedContentForChats={};this.dialogInput={};this.isLoading=false;this.isError=false;this.getAuth=function(){return _this.isAuth;};this.getLoading=function(){return _this.isLoading;};this.logout=function(){_this.removeTokensTolLocalStorage();_this.setAuth(false);_this.setProfile({});};makeAutoObservable(this);}_createClass(Store,[{key:\"setAuth\",value:function setAuth(bool){this.isAuth=bool;}},{key:\"getProfile\",value:function getProfile(){return this.profile;}},{key:\"setProfile\",value:function setProfile(profile){this.profile=profile;}},{key:\"getChats\",value:function getChats(){return this.chats;}},{key:\"setChats\",value:function setChats(chats){this.chats=chats;}},{key:\"getCurrentDialog\",value:function getCurrentDialog(){return this.currentDialog;}},{key:\"setCurrentDialog\",value:function setCurrentDialog(currentDialog){this.currentDialog=currentDialog;}},{key:\"getViewedDialogId\",value:function getViewedDialogId(){return this.viewedDialogId;}},{key:\"setViewedDialogId\",value:function setViewedDialogId(viewedDialogId){this.viewedDialogId=viewedDialogId;}},{key:\"getUploadedContentForChats\",value:function getUploadedContentForChats(){return this.uploadedContentForChats;}},{key:\"setUploadedContentForChats\",value:function setUploadedContentForChats(uploaded){this.uploadedContentForChats=uploaded;}},{key:\"getDialogInput\",value:function getDialogInput(){return this.dialogInput;}},{key:\"setDialogInput\",value:function setDialogInput(dialogInput){this.dialogInput=dialogInput;}},{key:\"getViewedUserProfile\",value:function getViewedUserProfile(){return this.viewedUserProfile;}},{key:\"setViewedUserProfile\",value:function setViewedUserProfile(viewedUserProfile){this.viewedUserProfile=viewedUserProfile;}},{key:\"getViewedUserProfileId\",value:function getViewedUserProfileId(){return this.viewedUserProfileId;}},{key:\"setViewedUserProfileId\",value:function setViewedUserProfileId(viewedUserProfileId){this.viewedUserProfileId=viewedUserProfileId;}},{key:\"getContacts\",value:function getContacts(){return this.contacts;}},{key:\"setContacts\",value:function setContacts(contacts){this.contacts=contacts;}},{key:\"setLoading\",value:function setLoading(bool){this.isLoading=bool;}},{key:\"setIsError\",value:function setIsError(bool){this.isError=bool;}},{key:\"getIsError\",value:function getIsError(){return this.isError;}},{key:\"setTokensTolLocalStorage\",value:function setTokensTolLocalStorage(response){localStorage.setItem(\"\".concat(process.env.REACT_APP_NAME_TOKEN),response.data.token);localStorage.setItem(\"\".concat(process.env.REACT_APP_NAME_REFRESH_TOKEN),response.data.refresh_token);}},{key:\"removeTokensTolLocalStorage\",value:function removeTokensTolLocalStorage(){localStorage.removeItem(\"\".concat(process.env.REACT_APP_NAME_TOKEN));localStorage.removeItem(\"\".concat(process.env.REACT_APP_NAME_REFRESH_TOKEN));}},{key:\"getProfileFromAPI\",value:function(){var _getProfileFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response;return _regeneratorRuntime().wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return UserService.profile();case 3:response=_context.sent;this.setProfile(response.data);_context.next=10;break;case 7:_context.prev=7;_context.t0=_context[\"catch\"](0);this.removeTokensTolLocalStorage();case 10:case\"end\":return _context.stop();}}},_callee,this,[[0,7]]);}));function getProfileFromAPI(){return _getProfileFromAPI.apply(this,arguments);}return getProfileFromAPI;}()},{key:\"signIn\",value:function(){var _signIn=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request){var _this2=this;var response;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=3;return AuthService.signIn(request);case 3:response=_context2.sent;this.setTokensTolLocalStorage(response);this.setAuth(true);_context2.next=8;return this.getProfileFromAPI();case 8:_context2.next=13;break;case 10:_context2.prev=10;_context2.t0=_context2[\"catch\"](0);this.setIsError(true);case 13:_context2.prev=13;setTimeout(function(){_this2.setIsError(false);},5000);return _context2.finish(13);case 16:case\"end\":return _context2.stop();}}},_callee2,this,[[0,10,13,16]]);}));function signIn(_x){return _signIn.apply(this,arguments);}return signIn;}()},{key:\"signUp\",value:function(){var _signUp=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(request){var _this3=this;var response;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.prev=0;_context3.next=3;return AuthService.signUp(request);case 3:response=_context3.sent;this.setTokensTolLocalStorage(response);this.setAuth(true);_context3.next=8;return this.getProfileFromAPI();case 8:_context3.next=13;break;case 10:_context3.prev=10;_context3.t0=_context3[\"catch\"](0);this.setIsError(true);case 13:_context3.prev=13;setTimeout(function(){_this3.setIsError(false);},5000);return _context3.finish(13);case 16:case\"end\":return _context3.stop();}}},_callee3,this,[[0,10,13,16]]);}));function signUp(_x2){return _signUp.apply(this,arguments);}return signUp;}()},{key:\"forgotPassword\",value:function(){var _forgotPassword=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(request){return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:_context4.prev=0;_context4.next=3;return AuthService.forgotPassword(request);case 3:_context4.next=8;break;case 5:_context4.prev=5;_context4.t0=_context4[\"catch\"](0);this.setIsError(true);case 8:case\"end\":return _context4.stop();}}},_callee4,this,[[0,5]]);}));function forgotPassword(_x3){return _forgotPassword.apply(this,arguments);}return forgotPassword;}()},{key:\"checkAuth\",value:function(){var _checkAuth=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var response;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1){switch(_context5.prev=_context5.next){case 0:this.setLoading(true);_context5.prev=1;_context5.next=4;return axios.post(refreshToken(),{\"refresh_token\":localStorage.getItem(\"\".concat(process.env.REACT_APP_NAME_REFRESH_TOKEN))});case 4:response=_context5.sent;this.setTokensTolLocalStorage(response);this.setAuth(true);_context5.next=9;return this.getProfileFromAPI();case 9:_context5.next=15;break;case 11:_context5.prev=11;_context5.t0=_context5[\"catch\"](1);this.removeTokensTolLocalStorage();this.setIsError(true);case 15:_context5.prev=15;this.setLoading(false);return _context5.finish(15);case 18:case\"end\":return _context5.stop();}}},_callee5,this,[[1,11,15,18]]);}));function checkAuth(){return _checkAuth.apply(this,arguments);}return checkAuth;}()},{key:\"getChatsFromAPI\",value:function(){var _getChatsFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _this4=this;var _e$response,_e$response$data;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1){switch(_context6.prev=_context6.next){case 0:_context6.prev=0;_context6.next=3;return ChatService.getChatsList().then(function(res){return _this4.setChats(res.data);});case 3:return _context6.abrupt(\"return\",_context6.sent);case 6:_context6.prev=6;_context6.t0=_context6[\"catch\"](0);if((_e$response=_context6.t0.response)!==null&&_e$response!==void 0&&(_e$response$data=_e$response.data)!==null&&_e$response$data!==void 0&&_e$response$data.message){console.error(_context6.t0.response.data.message);}case 9:case\"end\":return _context6.stop();}}},_callee6,null,[[0,6]]);}));function getChatsFromAPI(){return _getChatsFromAPI.apply(this,arguments);}return getChatsFromAPI;}()},{key:\"deleteProfileFromAPI\",value:function(){var _deleteProfileFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _this5=this;var _e$response2,_e$response2$data;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1){switch(_context7.prev=_context7.next){case 0:_context7.prev=0;this.setLoading(true);_context7.next=4;return UserService.deleteProfile().then(function(res){if(res.data.request_status){_this5.logout();}});case 4:_context7.next=9;break;case 6:_context7.prev=6;_context7.t0=_context7[\"catch\"](0);if((_e$response2=_context7.t0.response)!==null&&_e$response2!==void 0&&(_e$response2$data=_e$response2.data)!==null&&_e$response2$data!==void 0&&_e$response2$data.message){console.error(_context7.t0.response.data.message);}case 9:_context7.prev=9;this.setLoading(false);return _context7.finish(9);case 12:case\"end\":return _context7.stop();}}},_callee7,this,[[0,6,9,12]]);}));function deleteProfileFromAPI(){return _deleteProfileFromAPI.apply(this,arguments);}return deleteProfileFromAPI;}()},{key:\"updateProfileFromAPI\",value:function(){var _updateProfileFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(profileRequest){var _this6=this;var _e$response3,_e$response3$data;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1){switch(_context8.prev=_context8.next){case 0:_context8.prev=0;_context8.next=3;return UserService.updateProfile(profileRequest).then(function(res){if(res.status===200){_this6.setProfile(_objectSpread(_objectSpread({},_this6.getProfile()),res.data));_this6.setIsError(false);}});case 3:_context8.next=8;break;case 5:_context8.prev=5;_context8.t0=_context8[\"catch\"](0);if((_e$response3=_context8.t0.response)!==null&&_e$response3!==void 0&&(_e$response3$data=_e$response3.data)!==null&&_e$response3$data!==void 0&&_e$response3$data.message){this.setIsError(true);console.error(_context8.t0.response.data.message);}case 8:_context8.prev=8;setTimeout(function(){_this6.setIsError(false);},5000);return _context8.finish(8);case 11:case\"end\":return _context8.stop();}}},_callee8,this,[[0,5,8,11]]);}));function updateProfileFromAPI(_x4){return _updateProfileFromAPI.apply(this,arguments);}return updateProfileFromAPI;}()},{key:\"uploadAvatar\",value:function(){var _uploadAvatar=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(file){var _this7=this;var formData,_e$response4,_e$response4$data;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1){switch(_context9.prev=_context9.next){case 0:_context9.prev=0;formData=new FormData();formData.append('avatar',file);_context9.next=5;return UserService.uploadAvatar(formData).then(function(res){if(res.status===200){var _this7$getProfile$con;var profileContents={items:((_this7$getProfile$con=_this7.getProfile().content)===null||_this7$getProfile$con===void 0?void 0:_this7$getProfile$con.items.slice())||[]};// @ts-ignore\nprofileContents.items.push(res.data);_this7.setProfile(_objectSpread(_objectSpread({},_this7.getProfile()),{},{content:profileContents}));}});case 5:_context9.next=10;break;case 7:_context9.prev=7;_context9.t0=_context9[\"catch\"](0);if((_e$response4=_context9.t0.response)!==null&&_e$response4!==void 0&&(_e$response4$data=_e$response4.data)!==null&&_e$response4$data!==void 0&&_e$response4$data.message){console.error(_context9.t0.response.data.message);}case 10:case\"end\":return _context9.stop();}}},_callee9,null,[[0,7]]);}));function uploadAvatar(_x5){return _uploadAvatar.apply(this,arguments);}return uploadAvatar;}()},{key:\"deleteUserAvatarFromAPI\",value:function(){var _deleteUserAvatarFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(data,index){var _this8=this;var _e$response5,_e$response5$data;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1){switch(_context10.prev=_context10.next){case 0:_context10.prev=0;_context10.next=3;return ContentService.deleteContent(data).then(function(res){var _this8$getProfile$con;if(res.status===200&&data.id&&data.avatar&&(_this8$getProfile$con=_this8.getProfile().content)!==null&&_this8$getProfile$con!==void 0&&_this8$getProfile$con.items){var _this8$getProfile$con2;var profileContents={items:((_this8$getProfile$con2=_this8.getProfile().content)===null||_this8$getProfile$con2===void 0?void 0:_this8$getProfile$con2.items.slice())||[]};profileContents.items.splice(index,1);_this8.setProfile(_objectSpread(_objectSpread({},_this8.getProfile()),{},{content:profileContents}));}});case 3:_context10.next=8;break;case 5:_context10.prev=5;_context10.t0=_context10[\"catch\"](0);if((_e$response5=_context10.t0.response)!==null&&_e$response5!==void 0&&(_e$response5$data=_e$response5.data)!==null&&_e$response5$data!==void 0&&_e$response5$data.message){console.error(_context10.t0.response.data.message);}case 8:case\"end\":return _context10.stop();}}},_callee10,null,[[0,5]]);}));function deleteUserAvatarFromAPI(_x6,_x7){return _deleteUserAvatarFromAPI.apply(this,arguments);}return deleteUserAvatarFromAPI;}()},{key:\"deleteChatAvatarFromAPI\",value:function(){var _deleteChatAvatarFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(data,index,chatsListItem){var _this9=this;var _e$response6,_e$response6$data;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1){switch(_context11.prev=_context11.next){case 0:_context11.prev=0;_context11.next=3;return ContentService.deleteContent(data).then(function(res){if(res.status===200&&data.id&&data.avatar){var chats={items:_this9.getChats().items.slice()||[]};chats.items.forEach(function(chat,indexChat){if(chatsListItem.id===chat.id){var _chats$items$indexCha;(_chats$items$indexCha=chats.items[indexChat].content)===null||_chats$items$indexCha===void 0?void 0:_chats$items$indexCha.items.splice(index,1);}});_this9.setChats(_objectSpread(_objectSpread({},_this9.getChats()),{},{items:chats.items}));}});case 3:_context11.next=8;break;case 5:_context11.prev=5;_context11.t0=_context11[\"catch\"](0);if((_e$response6=_context11.t0.response)!==null&&_e$response6!==void 0&&(_e$response6$data=_e$response6.data)!==null&&_e$response6$data!==void 0&&_e$response6$data.message){console.error(_context11.t0.response.data.message);}case 8:case\"end\":return _context11.stop();}}},_callee11,null,[[0,5]]);}));function deleteChatAvatarFromAPI(_x8,_x9,_x10){return _deleteChatAvatarFromAPI.apply(this,arguments);}return deleteChatAvatarFromAPI;}()},{key:\"getContactsFromAPI\",value:function(){var _getContactsFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(){var _this10=this;var _e$response7,_e$response7$data;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1){switch(_context12.prev=_context12.next){case 0:_context12.prev=0;_context12.next=3;return ContactService.getContacts().then(function(res){if(res.status===200){_this10.setContacts(_objectSpread(_objectSpread({},_this10.getContacts()),res.data));}});case 3:_context12.next=8;break;case 5:_context12.prev=5;_context12.t0=_context12[\"catch\"](0);if((_e$response7=_context12.t0.response)!==null&&_e$response7!==void 0&&(_e$response7$data=_e$response7.data)!==null&&_e$response7$data!==void 0&&_e$response7$data.message){console.error(_context12.t0.response.data.message);}case 8:case\"end\":return _context12.stop();}}},_callee12,null,[[0,5]]);}));function getContactsFromAPI(){return _getContactsFromAPI.apply(this,arguments);}return getContactsFromAPI;}()},{key:\"addContactFromAPI\",value:function(){var _addContactFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(contactId){var _this11=this;var _e$response8,_e$response8$data;return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1){switch(_context13.prev=_context13.next){case 0:_context13.prev=0;_context13.next=3;return ContactService.addContact(contactId).then(function(res){if(res.status===200){var contactsList={items:_this11.getContacts().items.slice()||[]};// @ts-ignore\ncontactsList.items.push(res.data);_this11.setContacts(_objectSpread(_objectSpread({},_this11.getContacts()),contactsList));}});case 3:_context13.next=8;break;case 5:_context13.prev=5;_context13.t0=_context13[\"catch\"](0);if((_e$response8=_context13.t0.response)!==null&&_e$response8!==void 0&&(_e$response8$data=_e$response8.data)!==null&&_e$response8$data!==void 0&&_e$response8$data.message){console.error(_context13.t0.response.data.message);}case 8:case\"end\":return _context13.stop();}}},_callee13,null,[[0,5]]);}));function addContactFromAPI(_x11){return _addContactFromAPI.apply(this,arguments);}return addContactFromAPI;}()},{key:\"acceptContactFromAPI\",value:function(){var _acceptContactFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(contact,index){var _this12=this;var _e$response9,_e$response9$data;return _regeneratorRuntime().wrap(function _callee14$(_context14){while(1){switch(_context14.prev=_context14.next){case 0:_context14.prev=0;if(!contact.id){_context14.next=4;break;}_context14.next=4;return ContactService.acceptContact(contact.id).then(function(res){if(res.status===200){var contactsList={items:_this12.getContacts().items.slice()||[]};if(contactsList.items[index]){contactsList.items[index].status=true;}_this12.setContacts(_objectSpread(_objectSpread({},_this12.getContacts()),contactsList));}});case 4:_context14.next=9;break;case 6:_context14.prev=6;_context14.t0=_context14[\"catch\"](0);if((_e$response9=_context14.t0.response)!==null&&_e$response9!==void 0&&(_e$response9$data=_e$response9.data)!==null&&_e$response9$data!==void 0&&_e$response9$data.message){console.error(_context14.t0.response.data.message);}case 9:case\"end\":return _context14.stop();}}},_callee14,null,[[0,6]]);}));function acceptContactFromAPI(_x12,_x13){return _acceptContactFromAPI.apply(this,arguments);}return acceptContactFromAPI;}()},{key:\"deleteContactFromAPI\",value:function(){var _deleteContactFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(contact,index){var _this13=this;var _e$response10,_e$response10$data;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1){switch(_context15.prev=_context15.next){case 0:_context15.prev=0;if(!contact.id){_context15.next=4;break;}_context15.next=4;return ContactService.deleteContact(contact.id).then(function(res){if(res.status===200){var contactsList={items:_this13.getContacts().items.slice()||[]};contactsList.items.splice(index,1);_this13.setContacts(_objectSpread(_objectSpread({},_this13.getContacts()),contactsList));}});case 4:_context15.next=9;break;case 6:_context15.prev=6;_context15.t0=_context15[\"catch\"](0);if((_e$response10=_context15.t0.response)!==null&&_e$response10!==void 0&&(_e$response10$data=_e$response10.data)!==null&&_e$response10$data!==void 0&&_e$response10$data.message){console.error(_context15.t0.response.data.message);}case 9:case\"end\":return _context15.stop();}}},_callee15,null,[[0,6]]);}));function deleteContactFromAPI(_x14,_x15){return _deleteContactFromAPI.apply(this,arguments);}return deleteContactFromAPI;}()},{key:\"getDialogOrNewFromAPI\",value:function(){var _getDialogOrNewFromAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(otherUser){var _this14=this;var chat,_e$response11,_e$response11$data;return _regeneratorRuntime().wrap(function _callee16$(_context16){while(1){switch(_context16.prev=_context16.next){case 0:_context16.prev=0;chat={};_context16.next=4;return ChatService.getDialogOrNew(otherUser.id).then(function(res){if(res.status===200){var chatsList={items:_this14.getChats().items.slice()||[]};var flag=false;chatsList.items.forEach(function(item){if(item.id===res.data.id){chat=item;flag=true;}});if(!flag){// @ts-ignore\nchatsList.items.push(res.data);_this14.setChats(_objectSpread(_objectSpread({},_this14.getChats()),chatsList));chat=res.data;}}});case 4:return _context16.abrupt(\"return\",chat);case 7:_context16.prev=7;_context16.t0=_context16[\"catch\"](0);if((_e$response11=_context16.t0.response)!==null&&_e$response11!==void 0&&(_e$response11$data=_e$response11.data)!==null&&_e$response11$data!==void 0&&_e$response11$data.message){console.error(_context16.t0.response.data.message);}case 10:case\"end\":return _context16.stop();}}},_callee16,null,[[0,7]]);}));function getDialogOrNewFromAPI(_x16){return _getDialogOrNewFromAPI.apply(this,arguments);}return getDialogOrNewFromAPI;}()},{key:\"uploadFiles\",value:function(){var _uploadFiles=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(collectionFiles){var _this15=this;var chatId,chatsWithUploaded,_e$response12,_e$response12$data;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1){switch(_context18.prev=_context18.next){case 0:try{chatId=this.getViewedDialogId()||0;chatsWithUploaded={items:this.getUploadedContentForChats().items?this.getUploadedContentForChats().items.slice():[]};if(!chatsWithUploaded.items[chatId]){chatsWithUploaded.items[chatId]={uploadedContent:{items:[]}};}collectionFiles.map(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(file){var formData;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1){switch(_context17.prev=_context17.next){case 0:formData=new FormData();if(!file.type.includes(\"image\")){_context17.next=7;break;}formData.append('image',file);_context17.next=5;return ContentService.uploadImage(formData).then(function(res){if(res.status===200){// @ts-ignore\nchatsWithUploaded.items[chatId].uploadedContent.items.push(res.data);_this15.setUploadedContentForChats(_objectSpread(_objectSpread({},_this15.getUploadedContentForChats()),chatsWithUploaded));}});case 5:_context17.next=10;break;case 7:formData.append('file',file);_context17.next=10;return ContentService.uploadFile(formData).then(function(res){if(res.status===200){// @ts-ignore\nchatsWithUploaded.items[chatId].uploadedContent.items.push(res.data);_this15.setUploadedContentForChats(_objectSpread(_objectSpread({},_this15.getUploadedContentForChats()),chatsWithUploaded));}});case 10:case\"end\":return _context17.stop();}}},_callee17);}));return function(_x18){return _ref.apply(this,arguments);};}());}catch(e){if((_e$response12=e.response)!==null&&_e$response12!==void 0&&(_e$response12$data=_e$response12.data)!==null&&_e$response12$data!==void 0&&_e$response12$data.message){console.error(e.response.data.message);}}case 1:case\"end\":return _context18.stop();}}},_callee18,this);}));function uploadFiles(_x17){return _uploadFiles.apply(this,arguments);}return uploadFiles;}()},{key:\"deleteUploadedContent\",value:function(){var _deleteUploadedContent=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(chatId,contentId){var contentListItem,tempUploadedContent,_e$response13,_e$response13$data;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1){switch(_context19.prev=_context19.next){case 0:contentListItem={};tempUploadedContent=this.getUploadedContentForChats()?_objectSpread({},this.getUploadedContentForChats()):{items:[]};if(tempUploadedContent.items[chatId]){tempUploadedContent.items[chatId].uploadedContent.items.forEach(function(item,index){if(item.id===contentId){contentListItem=_objectSpread({},item);tempUploadedContent.items[chatId].uploadedContent.items.splice(index,1);}});}this.setUploadedContentForChats(_objectSpread(_objectSpread({},this.getUploadedContentForChats()),tempUploadedContent));if(!contentListItem){_context19.next=13;break;}_context19.prev=5;_context19.next=8;return ContentService.deleteContent(contentListItem).then();case 8:_context19.next=13;break;case 10:_context19.prev=10;_context19.t0=_context19[\"catch\"](5);if((_e$response13=_context19.t0.response)!==null&&_e$response13!==void 0&&(_e$response13$data=_e$response13.data)!==null&&_e$response13$data!==void 0&&_e$response13$data.message){console.error(_context19.t0.response.data.message);}case 13:case\"end\":return _context19.stop();}}},_callee19,this,[[5,10]]);}));function deleteUploadedContent(_x19,_x20){return _deleteUploadedContent.apply(this,arguments);}return deleteUploadedContent;}()},{key:\"addMessageAPI\",value:function(){var _addMessageAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(message){var _e$response14,_e$response14$data;return _regeneratorRuntime().wrap(function _callee20$(_context20){while(1){switch(_context20.prev=_context20.next){case 0:_context20.prev=0;_context20.next=3;return MessageService.addMessage(message).then();case 3:_context20.next=8;break;case 5:_context20.prev=5;_context20.t0=_context20[\"catch\"](0);if((_e$response14=_context20.t0.response)!==null&&_e$response14!==void 0&&(_e$response14$data=_e$response14.data)!==null&&_e$response14$data!==void 0&&_e$response14$data.message){console.error(_context20.t0.response.data.message);}case 8:case\"end\":return _context20.stop();}}},_callee20,null,[[0,5]]);}));function addMessageAPI(_x21){return _addMessageAPI.apply(this,arguments);}return addMessageAPI;}()},{key:\"updateMessageAPI\",value:function(){var _updateMessageAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(message){var _e$response15,_e$response15$data;return _regeneratorRuntime().wrap(function _callee21$(_context21){while(1){switch(_context21.prev=_context21.next){case 0:_context21.prev=0;_context21.next=3;return MessageService.updateMessage(message).then();case 3:_context21.next=8;break;case 5:_context21.prev=5;_context21.t0=_context21[\"catch\"](0);if((_e$response15=_context21.t0.response)!==null&&_e$response15!==void 0&&(_e$response15$data=_e$response15.data)!==null&&_e$response15$data!==void 0&&_e$response15$data.message){console.error(_context21.t0.response.data.message);}case 8:case\"end\":return _context21.stop();}}},_callee21,null,[[0,5]]);}));function updateMessageAPI(_x22){return _updateMessageAPI.apply(this,arguments);}return updateMessageAPI;}()},{key:\"deleteMessagesAPI\",value:function(){var _deleteMessagesAPI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(shortMessagesCollection){var _e$response16,_e$response16$data;return _regeneratorRuntime().wrap(function _callee22$(_context22){while(1){switch(_context22.prev=_context22.next){case 0:_context22.prev=0;_context22.next=3;return MessageService.deleteMessages(shortMessagesCollection).then();case 3:_context22.next=8;break;case 5:_context22.prev=5;_context22.t0=_context22[\"catch\"](0);if((_e$response16=_context22.t0.response)!==null&&_e$response16!==void 0&&(_e$response16$data=_e$response16.data)!==null&&_e$response16$data!==void 0&&_e$response16$data.message){console.error(_context22.t0.response.data.message);}case 8:case\"end\":return _context22.stop();}}},_callee22,null,[[0,5]]);}));function deleteMessagesAPI(_x23){return _deleteMessagesAPI.apply(this,arguments);}return deleteMessagesAPI;}()}]);return Store;}();export{Store as default};","map":{"version":3,"names":["makeAutoObservable","UserService","AuthService","ChatService","axios","refreshToken","ContentService","ContactService","MessageService","Store","isAuth","profile","chats","currentDialog","viewedDialogId","contacts","viewedUserProfile","viewedUserProfileId","uploadedContentForChats","dialogInput","isLoading","isError","getAuth","getLoading","logout","removeTokensTolLocalStorage","setAuth","setProfile","bool","uploaded","response","localStorage","setItem","process","env","REACT_APP_NAME_TOKEN","data","token","REACT_APP_NAME_REFRESH_TOKEN","refresh_token","removeItem","request","signIn","setTokensTolLocalStorage","getProfileFromAPI","setIsError","setTimeout","signUp","forgotPassword","setLoading","post","getItem","getChatsList","then","res","setChats","message","console","error","deleteProfile","request_status","profileRequest","updateProfile","status","getProfile","file","formData","FormData","append","uploadAvatar","profileContents","items","content","slice","push","index","deleteContent","id","avatar","splice","chatsListItem","getChats","forEach","chat","indexChat","getContacts","setContacts","contactId","addContact","contactsList","contact","acceptContact","deleteContact","otherUser","getDialogOrNew","chatsList","flag","item","collectionFiles","chatId","getViewedDialogId","chatsWithUploaded","getUploadedContentForChats","uploadedContent","map","type","includes","uploadImage","setUploadedContentForChats","uploadFile","e","contentId","contentListItem","tempUploadedContent","addMessage","updateMessage","shortMessagesCollection","deleteMessages"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/store/store.ts"],"sourcesContent":["import {makeAutoObservable} from \"mobx\";\nimport SignInRequest from \"../models/request/SignInRequest\";\nimport SignUpRequest from \"../models/request/SignUpRequest\";\nimport {UserService, AuthService, ChatService} from \"../services/\";\nimport {UserListItem} from \"../models/response/UserListItem\";\nimport axios, {AxiosResponse} from \"axios\";\nimport {AuthResponse} from \"../models/response/AuthResponse\";\nimport {refreshToken} from \"../routes\";\nimport ForgotPasswordRequest from \"../models/request/ForgotPasswordRequest\";\nimport {ChatsListResponse} from \"../models/response/ChatsListResponse\";\nimport {ChatsListItem} from \"../models/response/ChatsListItem\";\nimport ProfileRequest from \"../models/request/ProfileRequest\";\nimport {ContentListItem} from \"../models/response/ContentListItem\";\nimport ContentService from \"../services/ContentService\";\nimport {ContentListResponse} from \"../models/response/ContentListResponse\";\nimport {ContactListResponse} from \"../models/response/ContactListResponse\";\nimport ContactService from \"../services/ContactService\";\nimport {ContactListItem} from \"../models/response/ContactListItem\";\nimport {ShortChatList} from \"../models/uploadedStoreModel/ShortChatList\";\nimport {InputTextList} from \"../models/inputDialogModel/InputTextList\";\nimport MessageRequest from \"../models/request/MessageRequest\";\nimport MessageService from \"../services/MessageService\";\nimport UpdateMessageItem from \"../models/request/UpdateMessageItem\";\nimport {MessagesShortListRequest} from \"../models/request/MessagesShortListRequest\";\n\nexport default class Store {\n    private isAuth: boolean = false;\n    public profile = {} as UserListItem;\n    public chats = {} as ChatsListResponse;\n    public currentDialog = {} as ChatsListItem;\n    public viewedDialogId: number | null = null;\n    public contacts = {} as ContactListResponse;\n    private viewedUserProfile = {} as UserListItem;\n    public viewedUserProfileId: string | null = null;\n    public uploadedContentForChats = {} as ShortChatList;\n    public dialogInput = {} as InputTextList;\n    private isLoading: boolean = false;\n    private isError: boolean = false;\n\n    public constructor() {\n        makeAutoObservable(this);\n    }\n\n    private setAuth(bool: boolean): void {\n        this.isAuth = bool;\n    }\n\n    public getAuth: () => boolean = () => {\n        return this.isAuth;\n    }\n\n    public getProfile(): UserListItem {\n        return this.profile;\n    }\n\n    public setProfile(profile: UserListItem): void {\n        this.profile = profile;\n    }\n\n    public getChats(): ChatsListResponse {\n        return this.chats;\n    }\n\n    private setChats(chats: ChatsListResponse): void {\n        this.chats = chats;\n    }\n\n    public getCurrentDialog(): ChatsListItem {\n        return this.currentDialog;\n    }\n\n    public setCurrentDialog(currentDialog: ChatsListItem): void {\n        this.currentDialog = currentDialog;\n    }\n\n    public getViewedDialogId(): number | null {\n        return this.viewedDialogId;\n    }\n\n    public setViewedDialogId(viewedDialogId: number | null): void {\n        this.viewedDialogId = viewedDialogId;\n    }\n\n    public getUploadedContentForChats(): ShortChatList {\n        return this.uploadedContentForChats;\n    }\n\n    public setUploadedContentForChats(uploaded: ShortChatList): void {\n        this.uploadedContentForChats = uploaded;\n    }\n\n    public getDialogInput(): InputTextList {\n        return this.dialogInput;\n    }\n\n    public setDialogInput(dialogInput: InputTextList): void {\n        this.dialogInput = dialogInput;\n    }\n\n    public getViewedUserProfile(): UserListItem {\n        return this.viewedUserProfile;\n    }\n\n    public setViewedUserProfile(viewedUserProfile: UserListItem): void {\n        this.viewedUserProfile = viewedUserProfile;\n    }\n\n    public getViewedUserProfileId(): string | null {\n        return this.viewedUserProfileId;\n    }\n\n    public setViewedUserProfileId(viewedUserProfileId: string | null): void {\n        this.viewedUserProfileId = viewedUserProfileId;\n    }\n\n    public getContacts(): ContactListResponse {\n        return this.contacts;\n    }\n\n    public setContacts(contacts: ContactListResponse): void {\n        this.contacts = contacts;\n    }\n\n    private setLoading(bool: boolean): void {\n        this.isLoading = bool;\n    }\n\n    public getLoading: () => boolean = () => {\n        return this.isLoading;\n    }\n\n    public setIsError(bool: boolean): void {\n        this.isError = bool;\n    }\n\n    public getIsError(): boolean {\n        return this.isError;\n    }\n\n    public setTokensTolLocalStorage(response: AxiosResponse<AuthResponse>): void {\n        localStorage.setItem(\n            `${process.env.REACT_APP_NAME_TOKEN}`,\n            response.data.token\n        );\n        localStorage.setItem(\n            `${process.env.REACT_APP_NAME_REFRESH_TOKEN}`,\n            response.data.refresh_token\n        );\n    }\n\n    public removeTokensTolLocalStorage(): void {\n        localStorage.removeItem(`${process.env.REACT_APP_NAME_TOKEN}`);\n        localStorage.removeItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`);\n    }\n\n    public async getProfileFromAPI() {\n        try {\n            const response = await UserService.profile();\n            this.setProfile(response.data);\n        } catch (e) {\n            this.removeTokensTolLocalStorage();\n        }\n    }\n\n    public async signIn(request: SignInRequest) {\n        try {\n            const response = await AuthService.signIn(request);\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.setIsError(true);\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async signUp(request: SignUpRequest) {\n        try {\n            const response = await AuthService.signUp(request);\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.setIsError(true);\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async forgotPassword(request: ForgotPasswordRequest) {\n        try {\n            await AuthService.forgotPassword(request);\n        } catch (e) {\n            this.setIsError(true);\n        }\n    }\n\n     public logout = (): void => {\n        this.removeTokensTolLocalStorage();\n        this.setAuth(false);\n        this.setProfile({} as UserListItem);\n    }\n\n    public async checkAuth() {\n        this.setLoading(true);\n        try {\n            const response = await axios.post<AuthResponse>(\n                refreshToken(),\n                {\n                    \"refresh_token\": localStorage.getItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`)\n                }\n            );\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.removeTokensTolLocalStorage();\n            this.setIsError(true);\n        } finally {\n            this.setLoading(false);\n        }\n    }\n\n    public async getChatsFromAPI() {\n        try {\n            return await ChatService.getChatsList().then((res: any) => (\n                this.setChats(res.data)\n            ));\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteProfileFromAPI() {\n        try {\n            this.setLoading(true);\n            await UserService.deleteProfile().then((res: any) => {\n                if (res.data.request_status!) {\n                    this.logout();\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        } finally {\n            this.setLoading(false);\n        }\n    }\n\n    public async updateProfileFromAPI(profileRequest: ProfileRequest) {\n        try {\n            await UserService.updateProfile(profileRequest).then((res: any) => {\n                if (res.status === 200) {\n                    this.setProfile({\n                        ...this.getProfile(),\n                        ...res.data\n                    });\n                    this.setIsError(false);\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                this.setIsError(true);\n                console.error(e.response.data.message);\n            }\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async uploadAvatar(file: File) {\n        try {\n            const formData: FormData = new FormData();\n            formData.append('avatar', file);\n\n            await UserService.uploadAvatar(formData).then((res) => {\n                if (res.status === 200) {\n                    const profileContents: ContentListResponse = {\n                        items: this.getProfile().content?.items.slice() || []\n                    };\n\n                    // @ts-ignore\n                    profileContents.items.push(res.data);\n\n                    this.setProfile({\n                        ...this.getProfile(),\n                        content: profileContents\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteUserAvatarFromAPI(data: ContentListItem, index: number) {\n        try {\n            await ContentService.deleteContent(data).then((res: any) => {\n                if (\n                    res.status === 200 &&\n                    data.id &&\n                    data.avatar &&\n                    this.getProfile().content?.items\n                ) {\n                    const profileContents: ContentListResponse = {\n                        items: this.getProfile().content?.items.slice() || []\n                    };\n\n                    profileContents.items.splice(index, 1);\n\n                    this.setProfile({\n                        ...this.getProfile(),\n                        content: profileContents\n                    });\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteChatAvatarFromAPI(data: ContentListItem, index: number, chatsListItem: ChatsListItem) {\n        try {\n            await ContentService.deleteContent(data).then((res: any) => {\n                if (res.status === 200 && data.id && data.avatar) {\n                    const chats: ChatsListResponse = {\n                        items: this.getChats().items.slice() || []\n                    };\n\n                    chats.items.forEach((chat, indexChat) => {\n                        if (chatsListItem.id === chat.id) {\n                            chats.items[indexChat].content?.items.splice(index, 1);\n                        }\n                    });\n\n                    this.setChats({\n                        ...this.getChats(),\n                        items: chats.items\n                    });\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async getContactsFromAPI() {\n        try {\n            await ContactService.getContacts().then((res: any) => {\n                if (res.status === 200) {\n                    this.setContacts({\n                        ...this.getContacts(),\n                        ...res.data\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async addContactFromAPI(contactId: string) {\n        try {\n            await ContactService.addContact(contactId).then((res) => {\n                if (res.status === 200) {\n                    const contactsList: ContactListResponse = {\n                        items: this.getContacts().items.slice() || []\n                    };\n\n                    // @ts-ignore\n                    contactsList.items.push(res.data);\n\n                    this.setContacts({\n                        ...this.getContacts(),\n                        ...contactsList\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async acceptContactFromAPI(contact: ContactListItem, index: number) {\n        try {\n            if (contact.id) {\n                await ContactService.acceptContact(contact.id).then((res) => {\n                    if (res.status === 200) {\n                        const contactsList: ContactListResponse = {\n                            items: this.getContacts().items.slice() || []\n                        };\n\n                        if (contactsList.items[index]) {\n                            contactsList.items[index].status = true;\n                        }\n\n                       this.setContacts({\n                            ...this.getContacts(),\n                            ...contactsList\n                        });\n                    }\n                });\n            }\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteContactFromAPI(contact: ContactListItem, index: number) {\n        try {\n            if (contact.id) {\n                await ContactService.deleteContact(contact.id).then((res) => {\n                    if (res.status === 200) {\n                        const contactsList: ContactListResponse = {\n                            items: this.getContacts().items.slice() || []\n                        };\n\n                        contactsList.items.splice(index, 1);\n\n                        this.setContacts({\n                            ...this.getContacts(),\n                            ...contactsList\n                        });\n                    }\n                });\n            }\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async getDialogOrNewFromAPI(otherUser: UserListItem) {\n        try {\n            let chat = {} as ChatsListItem;\n\n            await ChatService.getDialogOrNew(otherUser.id).then((res) => {\n                if (res.status === 200) {\n                    const chatsList: ChatsListResponse = {\n                        items: this.getChats().items.slice() || []\n                    };\n                    let flag: boolean = false;\n\n                    chatsList.items.forEach((item) => {\n                        if (item.id === res.data.id) {\n                            chat = item;\n                            flag = true;\n                        }\n                    });\n\n                    if (!flag) {\n                        // @ts-ignore\n                        chatsList.items.push(res.data);\n                        this.setChats({\n                            ...this.getChats(),\n                            ...chatsList\n                        });\n                        chat = res.data;\n                    }\n                }\n            });\n            return chat;\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async uploadFiles(collectionFiles: File[]) {\n        try {\n            const chatId: number = this.getViewedDialogId() || 0;\n\n            let chatsWithUploaded = {\n                items: (this.getUploadedContentForChats().items)?\n                    this.getUploadedContentForChats().items.slice():\n                    []\n            } as ShortChatList;\n\n            if (!chatsWithUploaded.items[chatId]) {\n                chatsWithUploaded.items[chatId] = {\n                    uploadedContent: {\n                        items: []\n                    }\n                }\n            }\n\n            collectionFiles.map(async (file: File) => {\n                const formData: FormData = new FormData();\n\n                if (file.type.includes(\"image\")) {\n                    formData.append('image', file);\n\n                    await ContentService.uploadImage(formData).then((res) => {\n                        if (res.status === 200) {\n                            // @ts-ignore\n                            chatsWithUploaded.items[chatId].uploadedContent.items.push(res.data);\n\n                            this.setUploadedContentForChats({\n                                ...this.getUploadedContentForChats(),\n                                ...chatsWithUploaded\n                            });\n                        }\n                    });\n                } else {\n                    formData.append('file', file);\n\n                    await ContentService.uploadFile(formData).then((res) => {\n                        if (res.status === 200) {\n                            // @ts-ignore\n                            chatsWithUploaded.items[chatId].uploadedContent.items.push(res.data);\n\n                            this.setUploadedContentForChats({\n                                ...this.getUploadedContentForChats(),\n                                ...chatsWithUploaded\n                            });\n                        }\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteUploadedContent(chatId: number, contentId: string) {\n        let contentListItem = {} as ContentListItem;\n        const tempUploadedContent: ShortChatList = (this.getUploadedContentForChats())?\n            {...this.getUploadedContentForChats()}:\n            {items: []};\n\n        if (tempUploadedContent.items[chatId]) {\n            tempUploadedContent.items[chatId].uploadedContent.items.forEach((item: ContentListItem, index) => {\n                if (item.id === contentId) {\n                    contentListItem = {...item};\n                    tempUploadedContent.items[chatId].uploadedContent.items.splice(index, 1);\n                }\n            });\n        }\n\n        this.setUploadedContentForChats({\n            ...this.getUploadedContentForChats(),\n            ...tempUploadedContent\n        });\n\n        if (contentListItem) {\n            try {\n                await ContentService.deleteContent(contentListItem).then();\n\n            } catch (e: any) {\n                if (e.response?.data?.message!) {\n                    console.error(e.response.data.message);\n                }\n            }\n        }\n    }\n\n    public async addMessageAPI(message: MessageRequest) {\n        try {\n            await MessageService.addMessage(message).then();\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async updateMessageAPI(message: UpdateMessageItem) {\n        try {\n            await MessageService.updateMessage(message).then();\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteMessagesAPI(shortMessagesCollection: MessagesShortListRequest) {\n        try {\n            await MessageService.deleteMessages(shortMessagesCollection).then();\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n}"],"mappings":"mtBAAA,OAAQA,kBAAkB,KAAO,MAAM,CAGvC,OAAQC,WAAW,CAAEC,WAAW,CAAEC,WAAW,KAAO,cAAc,CAElE,MAAOC,MAAK,KAAuB,OAAO,CAE1C,OAAQC,YAAY,KAAO,WAAW,CAMtC,MAAOC,eAAc,KAAM,4BAA4B,CAGvD,MAAOC,eAAc,KAAM,4BAA4B,CAKvD,MAAOC,eAAc,KAAM,4BAA4B,CAAC,GAInCC,MAAK,yBActB,gBAAqB,iDAbbC,MAAM,CAAY,KAAK,MACxBC,OAAO,CAAG,CAAC,CAAC,MACZC,KAAK,CAAG,CAAC,CAAC,MACVC,aAAa,CAAG,CAAC,CAAC,MAClBC,cAAc,CAAkB,IAAI,MACpCC,QAAQ,CAAG,CAAC,CAAC,MACZC,iBAAiB,CAAG,CAAC,CAAC,MACvBC,mBAAmB,CAAkB,IAAI,MACzCC,uBAAuB,CAAG,CAAC,CAAC,MAC5BC,WAAW,CAAG,CAAC,CAAC,MACfC,SAAS,CAAY,KAAK,MAC1BC,OAAO,CAAY,KAAK,MAUzBC,OAAO,CAAkB,UAAM,CAClC,MAAO,MAAI,CAACZ,MAAM,CACtB,CAAC,MA8EMa,UAAU,CAAkB,UAAM,CACrC,MAAO,MAAI,CAACH,SAAS,CACzB,CAAC,MAyEOI,MAAM,CAAG,UAAY,CACzB,KAAI,CAACC,2BAA2B,EAAE,CAClC,KAAI,CAACC,OAAO,CAAC,KAAK,CAAC,CACnB,KAAI,CAACC,UAAU,CAAC,CAAC,CAAC,CAAiB,CACvC,CAAC,CAtKG3B,kBAAkB,CAAC,IAAI,CAAC,CAC5B,CAAC,yCAED,iBAAgB4B,IAAa,CAAQ,CACjC,IAAI,CAAClB,MAAM,C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